package com.atguigu.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author : wenchao.long
 * @date : Created in 2020/11/02 10:15 周一
 * @description :
 */
@Controller
public class RestFulController {

    @GetMapping("/add/{a}/{b}")
    public String test1(@PathVariable("a") Integer a,
                        @PathVariable("b") Integer b,
                        Model model) {
        int res = a + b;
        model.addAttribute("msg", "最终结果" + res);
        return "hello";
    }
}
